package atom.core3.hibernate.jpa;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

public class DBAnnotationManager
{
	private static Map<Class, DBAnnotation>	dbAnnotationMap	= new ConcurrentHashMap();

	public static DBAnnotation scanDBAnnotation(Class myClass)
	{
		DBAnnotation dbAnnotation;
		dbAnnotation = dbAnnotationMap.get(myClass);
		if (dbAnnotation == null)
		{
			dbAnnotation = AnnotationUtil.scanDBAnnotation(myClass);
			dbAnnotationMap.put(myClass, dbAnnotation);
		}
		return dbAnnotation;
	}

	public static DBAnnotation getDBAnnotation(Class myClass)
	{
		DBAnnotation dbAnnotation = dbAnnotationMap.get(myClass);
		return dbAnnotation;
	}

}
